<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="drukarnia.controller.JFTP"%>
<%@page import="drukarnia.model.User"%>

    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body><h3>Download</h3>
<%

User user = (User)session.getAttribute("user");
String id = request.getParameter("id");
String katalog = request.getParameter("katalog");
if(user != null){
	

String file = request.getParameter("file");
%>
<h3>Pobieram plik: <i><%= file %></i></h3><br>
<%
JFTP jftp = new JFTP();
jftp.download(file, out, katalog);
%>
<br>
<br>
<%
}else{
	 response.sendError(404,"Drukarnia: brak uprawnien");
	}
%>

<h2><a href="orderDetailsADMIN.jsp?id=<%= id %>">Powrót</a></h2>
</body>
</html>